Skip to content

fix(auth): pass raw Astro action reference to fix production payload extraction - #102

Merged
saifulalomdev merged 1 commit into
mainfrom
features
Jun 17, 2026
Merged

fix(auth): pass raw Astro action reference to fix production payload extraction#102
saifulalomdev merged 1 commit into
mainfrom
features

Conversation

@saifulalomdev

Copy link
Copy Markdown
Owner

📝 Description

This PR resolves a silent payload serialization bug where the application would successfully log in but fail to redirect to the dashboard in production.

Key Changes:

  • Direct Action Mapping: Removed the redundant async/await wrapper inside useAction and passed the raw actions.login reference directly.
  • Payload Extraction Fix: Eliminating the custom manual object wrapping ensures that Astro's native { data, error } serialization structure is preserved perfectly over the network, allowing the onSuccess callback to correctly read data.success on Cloudflare Edge runtimes.

Fixes # (issue number)

🧪 Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor / Chore (codebase maintenance or optimization)

🛠️ How Has This Been Tested?

  • Verified that passing the direct action pipeline matches the expected utility contracts in local dev environments.

  • Ensured successful compilation without edge-case type mismatches.

  • Unit/Integration tests added/passed

  • Local manual edge verification successful

📸 Screenshots / Diffs (if applicable)

Modified File: src/modules/auth/auth.hooks.ts

✅ Checklist

  • My code follows the brutalist/minimal style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new typescript compiler or linter errors

…extraction

- Remove manual wrapper function and directly pass `actions.login` reference to `useAction`
- Fix type-mapping mismatch that caused `onSuccess` data serialization to fail on the edge
- Strip redundant error-mapping layer to match Astro's native payload structure
@saifulalomdev
saifulalomdev merged commit ad72f73 into main Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant